const router = require('../routerInstanceObject')
const upload_imgRouter_handle = require('../router_handle/uploads_imgRouter_handle')
const uploadModule = require('../uploads/index')
const uploadHeadImage = uploadModule.uploadFun('./headImages')
const uploadUserGoodsImgs = uploadModule.uploadFun('./usedGoodsImgs')
const uploadWallImgs = uploadModule.uploadFun('./confessionWallImgs')

// 发送已上传的头像图片的地址
router.post('/uploadHeadImg', uploadHeadImage.single('file'), upload_imgRouter_handle.sendImgSrc);

// 发送已上传的多张二手物品图片的地址
router.post('/uploadUserGoodsImgs', uploadUserGoodsImgs.single('file'), upload_imgRouter_handle.sendUsedGoodsImgSrcs);

// 发送已上传的墙图片地址
router.post('/sendWallImgs', uploadWallImgs.single('file'), upload_imgRouter_handle.sendWallImgs);

module.exports = router